package edu.uts.reekie.designer.conceptual;

import org.eclipse.gef.EditPartFactory;
import org.eclipse.gef.EditPartViewer;
import org.eclipse.gef.palette.PaletteRoot;
import org.eclipse.gef.ui.actions.ActionRegistry;
import org.eclipse.jface.action.IAction;

import edu.uts.reekie.designer.AbstractContextMenuProvider;
import edu.uts.reekie.designer.AbstractViewEditor;
import edu.uts.reekie.designer.conceptual.actions.*;
import edu.uts.reekie.designer.conceptual.edit.ViewPartFactory;
import edu.uts.reekie.designer.conceptual.model.ViewDiagram;
import edu.uts.reekie.designer.model.AbstractDiagram;

public class ViewEditor extends AbstractViewEditor {
	
	public ViewEditor() {
		
	}
	
	@Override
	protected  void registerComponentActions(){
		
	}
	
	@Override
	protected void registerConnectorActions() {
		
		// stereo type changing actions
		registerAction(new SetUnsetComponentPersistenceStereotypeAction(this, true));
		registerAction(new SetUnsetComponentPersistenceStereotypeAction(this, false));
		
		registerAction(new SetUnsetComponentPresentationStereotypeAction(this, true));
		registerAction(new SetUnsetComponentPresentationStereotypeAction(this, false));
		
		registerAction(new SetUnsetComponentRealTimeStereotypeAction(this, true));
		registerAction(new SetUnsetComponentRealTimeStereotypeAction(this, false));
	}

	@Override
	protected AbstractContextMenuProvider createContextMenuProvider(EditPartViewer viewer) {
		return new ContextMenuProvider(viewer, getActionRegistry());
		
	}

	@Override
	protected AbstractDiagram createDiagram() {
		return new ViewDiagram();
	}

	@Override
	protected EditPartFactory createEditPartFactory() {
		return new ViewPartFactory();
	}

	@Override
	protected PaletteRoot createPaletteRoot() {
		
		return new ViewPaletteFactory().createPalette();
	}
	protected void createActions() {
		super.createActions();
	}
		
	
	

}
